class Toast extends eui.Label
{
	 public constructor(text: string)
	 {
		super(text);
		this.init();
	 }

	 private init()
	 {
		this.background = true;
		this.backgroundColor = 0x111010;

		this.anchorOffsetX = 0.5;
		
		this.x = S_WIDTH * 0.5;
		this.y = S_HEIGHT * 0.25;

		var tw = egret.Tween.get(this);
		tw.to({y:this.y - 150, alpha:0}, 1000).call(function(){this.parent.removeChild(this);});

		SceneManager.getInstance().getRunningScene().addChild(this);
	 }
}